<%@page contentType="text/html;charset=utf-8" %>
<%@taglib prefix="s" uri="/struts-tags" %>   
<script type="text/javascript">
function mg_savepayversion(type)
{
    var name = document.getElementById("model.versionname").value;
    var code = document.getElementById("model.versioncode").value;
    if (name == null || name == ""
        || code == null || code == "")
    {
        alert("信息不完整！");
        return false;
    }

    if (!confirm("确定继续？"))
    {
        return false;
    }
    var url = "mg/payversion/save.do?type=" + type;
    var objectid = "mg_payversion_div";
    postXMLHttpRequest(url, "myform", objectid); 
}
</script>
 <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="5"></td>
    <td>   
  <form id="myform" name="myform"
        method="post" action="">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td colspan="3">
        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><img src="images/table_top_left.jpg" width="20" height="15" /></td>
            <td><img src="images/table_top_bg.jpg" width="770" height="15"/></td>
            <td align="right">
              <img src="images/table_top_right.jpg" width="20" height="15" /></td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td height="25" colspan="3" class="table_blue">
        <strong><img src="images/dot.jpg" width="13" height="9">支付版本信息</strong>
         <input type="hidden" id="model.id" name="model.id"  value="<s:property value="model.id" />" />
        <input type="hidden" id="model.createuser" name="model.createuser"  value="<s:property value="model.createuser" />" />
        <input type="hidden" id="model.createdate" name="model.createdate"  value="<s:property value="model.createdate" />" />
        </td>
    </tr> 
    <tr>
      <td class="table_w1" align="center" width="20%">&nbsp;<font color="red">(*)</font>版本：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <input id="model.versionname" name="model.versionname" type="text" size="60" 
          value="<s:property value="model.versionname" />" <s:if test="type.equals('update')" >readonly</s:if>/></td>
    </tr>
    <tr>
      <td class="table_w1" align="center" width="20%">&nbsp;<font color="red">(*)</font>版本号：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <input id="model.versioncode" name="model.versioncode" type="text" size="60" 
          value="<s:property value="model.versioncode" />" <s:if test="type.equals('update')" >readonly</s:if>/></td>
    </tr>
    <tr>
      <td class="table_w1" align="center" width="20%">&nbsp;<font color="red">(*)</font>提示语模版：</td>
      <td class="table_w2" colspan="2">&nbsp;
      	  <select id="model.confirmtemplateid" name="model.confirmtemplateid">
      	  		<s:iterator value="ctlist">
      	  			<option value="<s:property value="id"/>" <s:if test="id==model.confirmtemplateid">selected</s:if>><s:property value="templatename"/></option>
      	  		</s:iterator>
      	  </select>
      </td>
    </tr>
    <tr>
      <td class="table_w1" align="center" width="20%">&nbsp;<font color="red">(*)</font>备注：</td>
      <td class="table_w2" colspan="2">&nbsp;
          <textarea id="model.remark" name="model.remark"  rows="5" cols="60"><s:property value="model.remark" /></textarea>
          </td>
    </tr>
    <tr>
      <td colspan="3" class="table_w1" align="center">
        <s:if test="type.equals('insert')" >
        <button id="btn2" dojoType="dijit.form.Button"
            onclick="mg_savepayversion('insert');">添加</button>
        </s:if>
        <s:else>
        <button id="btn2" dojoType="dijit.form.Button"
            onclick="mg_savepayversion('update');">修改</button>
        &nbsp;&nbsp;        
        <button id="btn3" dojoType="dijit.form.Button"
            onclick="mg_savepayversion('delete');">删除</button>
        </s:else>
      </td>      
    </tr>
    <tr> 
      <td colspan="3" background="images/table_bom_bg.jpg">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="images/table_bom_left.jpg" width="20" height="15"></td>
          <td></td>
          <td align="right">
            <img src="images/table_bom_right.jpg" width="20" height="15"></td>
        </tr>
        </table>
      </td>
    </tr>
  </table>  
  </form>
  </td>
  <td width="5"></td>
  </tr>
  </table>